#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'
require_relative '../lib/shell'

options = {
  rc_path: nil
}

OptionParser.new do |opts|
  opts.banner = '配置 setup-env 的环境'

  opts.on('-p', '--rc-path PATH', '定义配置文件路径，如 `~/.bashrc`') do |rc_path|
    options[:rc_path] = rc_path
  end
end.parse!

shell.rc_append [
  'export PATH=~/.config/setup-env:$PATH', 'source ~/.config/setup-env/bash_completion'
], options[:rc_path]
